#ifndef EFECT_H
#define EFECT_H

#include "object.h"
#include "timer.h"
#include "resman.h"

#define FX_MODE_LOOP    0x01
#define FX_MODE_ONCE    0x02

class Efect : public Object
{
    public:
        Efect();
        virtual ~Efect();

        i32 Set(string v_resource, i32 duration_ms, i32 ms_per_frame, i32 x, i32 y);
        i32 Start();
        i32 Stop();

//        i32 Move(i32 x, i32 y);
        i32 ChangeDuration(i32 duration_ms);

        i32 Render();

    protected:

        i32 dead;
        i32 mode;
        i32 actual_frame;
        void killme();
        void switch_frame();

        Timer efect_duration;
        Timer frame_keeper;
        i32 frame_interval;
        Graphics *graph;

    protected:
    private:
};

#endif // EFECT_H
